/*
	Name:
	Copyright:Take it at will
	Author:Rodney
	Date: 
	Description:
*/
#include<stdio.h>
#include<stdlib.h>

void use_switch(int x,int y);

int main()
{
	int x , y;
	scanf("%d",&x);
	if(x<0)	y = 0;
	else if(x<10)	y = x;
	else if(x<20)  	y = 10;
	else if(x<40)	y = -0.5*x+20;
	
	printf("%d\n",y);
	use_switch(x,y);
}

void use_switch(int x,int y)
{
	int c=-1;
	c=x/10;
	switch(c)
	{
		case -1:y=0;break;
		case 0:y=x;break;
		case 1:y=10;break;
		case 2:
		case 3:y=-0.5*x+20;
	}
	printf("%d\n",y);
}
